// import { defineConfig } from "vite";
// import uni from "@dcloudio/vite-plugin-uni";

// // https://vitejs.dev/config/
// export default defineConfig({
//   plugins: [uni()],
// });

import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import vue from '@vitejs/plugin-vue';
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from '@vant/auto-import-resolver';
import alias from "@rollup/plugin-alias";
import styleImport, { VantResolve } from 'vite-plugin-style-import';
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    alias( ),
    uni(),
   //  vue(),
    Components({
      resolvers: [VantResolver()],
    }),
    ,
    styleImport({
      resolves: [VantResolve()],
      libs: [
        {
          libraryName: 'vant',
          esModule: true,
          resolveStyle: name => `../es/${name}/style`
        }
      ]
    }),
  ],
  resolve: {
    alias: {
      "/@": path.resolve(__dirname, "./src"),
    },
  },
  build:{
    rollupOptions:{
      external:['axios']
    }
  }
});
